﻿#pragma once
#include <string>
class orders
{
public:
	enum OrderStatus { booked, canceled, changed };
	//构造函数
	orders() = default;
	orders(int order_id, int user_id, int train_id, int seat_id, int start_station_id, int end_station_id, const std::string& travel_date,
		const std::string& order_time, const OrderStatus& status, double price = 0.0);
	//Get方法声明
	int getOrderId() const;
	int getUserId() const;
	int getTrainId() const;
	int getSeatId() const;
	int getStartStationId() const;
	int getEndStationId() const;
	std::string getTravelDate() const;
	std::string getOrderTime() const;
	OrderStatus getStatus() const;
	double getPrice() const; // 新增
	// Set方法声明
	void setOrderId(int id);
	void setUserId(int id);
	void setTrainId(int id);
	void setSeatId(int id);
	void setStartStationId(int id);
	void setEndStationId(int id);
	void setTravelDate(const std::string& date);
	void setOrderTime(const std::string& time);
	void setStatus(const OrderStatus status);
	void setPrice(double price); // 新增
private:

	int order_id; // 订单ID
	int user_id; // 用户ID
	int train_id; // 火车ID
	int seat_id; // 座位ID
	int start_station_id; // 起始站ID
	int end_station_id; // 终点站ID
	std::string travel_date; // 旅行日期
	std::string order_time; // 订单时间
	OrderStatus status; // 订单状态（已预定、已改签、已取消等）
	double price = 0.0; // 新增票价字段
};

